﻿using Myotragus.Data.Criteria;
using Myotragus.Data.Domain;

namespace Myotragus.Data.Repositories
{
	public interface IReadRepository<TEntity> : IRepository<TEntity>
		where TEntity : IEntity
	{
		IPagedQuery<TEntity> FindAll();

		int CountAll();

		IPagedQuery<TEntity> FindMatching(object pattern);

		int CountMatching(object pattern);

		IPagedQuery<TEntity> FindLike(object pattern);

		int CountLike(object pattern);
	}

	public interface IReadRepository<TEntity, TId> : IReadRepository<TEntity>
		where TEntity : IEntity<TId>
	{
		TEntity FindById(TId id);

		bool Exists(TId id);
	}
}